package com.example.demo.web.model;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ResultInfo<T> implements Serializable {

    private String code;
    private Boolean success;
    private T object;
    private String msg;

    public static <T> ResultInfo<T> buildSuccess(T t){
        ResultInfo resultInfo = new ResultInfo();
        resultInfo.setSuccess(true);
        resultInfo.setObject(t);
        return  resultInfo;
    }
}
